package com.example.demo.event.listener;

import com.example.demo.event.base.AbstractAsyncEventListener;
import com.example.demo.event.base.EventSource;
import com.example.demo.event.source.DemoEventSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * demo事件监听
 */
@Component
public class DemoEventListener extends AbstractAsyncEventListener<DemoEventSource> {

	private final static Logger LOG = LoggerFactory.getLogger(DemoEventListener.class);


	@Override
	public void exec(EventSource<DemoEventSource> eventSource) {

		DemoEventSource eventVO = eventSource.getSource();
		LOG.info("接收事件： source={}", eventVO.toString());

		// do something......
		LOG.info("具体业务处理......");

		LOG.info("处理事件完毕： source={}", eventVO.toString());
	}

}
